home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / textfile / faqs / fonts_fa / part04 < prev    next >
Encoding:
Internet Message Format  |  1992-12-26  |  20.1 KB

  1. Xref: bloom-picayune.mit.edu comp.fonts:6624 news.answers:4476
  2. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!think.com!rpi!zaphod.mps.ohio-state.edu!caen!nic.umass.edu!dime!dime.cs.umass.edu!walsh
  3. From: walsh@cs.umass.edu (Norman Walsh)
  4. Newsgroups: comp.fonts,news.answers
  5. Subject: comp.fonts FAQ.3.MS-DOS-Info
  6. Summary: This posting answers frequently asked questions about fonts.
  7.          It addresses both general font questions and questions that
  8.      are specific to a particular platform.
  9. Message-ID: <WALSH.92Dec7141536@ibis.cs.umass.edu>
  10. Date: 7 Dec 92 19:15:36 GMT
  11. Expires: 8 Jan 93 00:00:00 GMT
  12. References: <9212071410.WW57338@cs.umass.EDU>
  13. Sender: news@dime.cs.umass.edu
  14. Reply-To: walsh@cs.umass.edu (Norm Walsh)
  15. Followup-To: poster
  16. Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
  17. Lines: 473
  18. Approved: news-answers-request@MIT.Edu
  19.  
  20. Archive-name: fonts-faq/part04
  21. Version: 1.1.1.
  22.  
  23. FAQ for comp.fonts: Chapter III: MS-DOS-specific Info
  24.  
  25. Version 1.1.1., Release 07DEC92
  26.  
  27. Welcome to the comp.fonts FAQ.  These articles, posted monthly, describe many
  28. of the basic questions that seem to be repeated frequently on comp.fonts.
  29. Your comments are both welcome and encouraged.
  30.  
  31. The FAQ is divided into chapters.  The first chapter is a general overview.
  32. Most of the remaining chapters are more-or-less platform specific.
  33.  
  34. For more information about the FAQ, please consult the beginning of the first
  35. chapter.  The FAQ is always available via anonymous ftp from ibis.cs.umass.edu
  36. in /pub/norm/comp.fonts/FAQ*
  37.  
  38. This chapter covers the following topics:
  39.  
  40. 1.    MS-DOS font notes
  41. 2.    Font installation
  42. 3.    Font utilities
  43. 4.    Converting Macintosh Type1 fonts to MS-DOS format
  44. 5.1    Converting PC Type1 fonts into TeX PK bitmap fonts
  45. 5.2    Converting TeX PK bitmaps into HP LaserJet softfonts (and vice-versa)
  46. 5.3    Converting TrueType fonts to HP LaserJet bitmap softfonts (HACK!)
  47. 6.    MS-DOS Screen Fonts (EGA/VGA text-mode fonts)
  48.  
  49. ------------------------------------------------------------------------------
  50.  
  51. 1. MS-DOS font notes
  52.  
  53.   The easiest way to get outline fonts under MS-DOS is with MicroSoft
  54.   Windows 3.x or OS/2 2.x.
  55.  
  56.   MicroSoft Windows 3.0 with Adobe Type Manager (ATM) and OS/2 2.0 support
  57.   PostScript Type1 fonts.
  58.  
  59.   MicroSoft Windows 3.1 supports TrueType fonts natively.
  60.  
  61.   Bitmap fonts are available in a variety of formats: most formats are
  62.   designed with the printer in mind and not the display since (prior to
  63.   graphical environments like Windows, GEM, and OS/2) the majority of work
  64.   under MS-DOS was done with a character-based interface.
  65.  
  66. 1.2. Frequently requested fonts
  67.  
  68.   Many fonts are available at various archives.  The biggest font archive
  69.   for MS-DOS format fonts is ftp.cica.indiana.edu.  Note: you can use any
  70.   Mac format Type1 font on your PC by converting it to PC format with the
  71.   free/shareware as described below.
  72.  
  73.   The following fonts are in Type 1 format for MS-DOS. Some are also
  74.   available in TrueType format.
  75.  
  76.   Hebrew        ShalomScript, ShalomOldStyle, ShalomStick
  77.  
  78.   Japanese      Shorai
  79.  
  80.   Start Trek    Crillee, TNG monitors
  81.  
  82. 2. Font Installation
  83.  
  84.   If you have any information that you feel belongs in this section, it
  85.   would be greatly appreciated.
  86.  
  87.   Windows
  88.  
  89.     Pat Farrell <pfarrell@cs.gmu.edu> contributes the following description
  90.     of font installation under Windows.
  91.  
  92.     Installing Fonts into Windows:
  93.  
  94.     This only covers Windows 3.1. Font is a four-letter word in Windows 
  95.     versions prior to 3.1 due to the distinctions between screen fonts and 
  96.     printer fonts. The upgrade price of Windows 3.1 is justified by the 
  97.     integration of TrueType into the package and the inclusion of useful 
  98.     fonts for all printers.
  99.  
  100.     Commercial fonts usually have installation instructions with their 
  101.     manuals. The approach may differ from the method used for PD and 
  102.     shareware fonts.
  103.  
  104.     To install PD and shareware fonts in Windows 3.1:
  105.  
  106.       1. Copy the fonts onto a suitable scratch area (i.e. a floppy, or any 
  107.          temporary area of your hard disk.
  108.  
  109.       2. Execute "Control Panel" by double-clicking on the icon in the 
  110.          Windows Program Manager's "main" group.
  111.  
  112.       3. Double-click on the Fonts icon.
  113.  
  114.       4. Double-click on the "Add" button.
  115.  
  116.       5. Select the scratch directory holding the new fonts.
  117.  
  118.       6. A list of the fonts will be displayed. You can manually select the 
  119.          fonts you like, or you can use the "Select All" button.
  120.  
  121.       7. Make sure the "Copy Fonts to Windows Directory" check-box is 
  122.          checked. This will copy the fonts from the scratch area to your 
  123.          Windows directory.
  124.  
  125.       8. Click on the "Ok" button.
  126.  
  127.     Special notes for Windows applications:
  128.  
  129.     Word for Windows (W4W) stores font/printer information in its own 
  130.     initialization files. After you add new fonts, you have to tell W4W 
  131.     that the printer can use the new fonts. Do this by selecting "Printer 
  132.     Setup" from the W4W main "File" menu item, click on the "Setup" button, 
  133.     and then click on two "Ok" buttons to back out of the setup mode.
  134.  
  135.     Note concerning Windows 3.1 upgrade:
  136.  
  137.     There are two upgrade packages available from Microsoft for Win3.1.  
  138.     There is the standard version which contains TypeType support, and 
  139.     about six font families (Times New Roman, Arial, Courier, Symbols, 
  140.     Wingdings, etc.). It costs something like $50 (US). The second version 
  141.     contains a number of TrueType fonts that includes equivalents for the 
  142.     35 standard Postscript fonts. This adds an additional $50, which is a 
  143.     pretty good value.  However, if you plan on buying Microsoft's 
  144.     PowerPoint, it includes the same additional fonts/typefaces. So you can 
  145.     save money by not buying the fonts twice.
  146.  
  147.   More about Windows
  148.  
  149.     Q: Why are don't the TrueType fonts that come with Microsoft products
  150.        (Word-for-Windows, PowerPoint, Windows 3.1 TrueType Font Pack, etc.)
  151.        display and print properly on my system?
  152.  
  153.     A: The font matching algorithm in Win3.1 is fairly simplistic.  If you
  154.        install lots of TrueType fonts, the algorithm can get confused. In
  155.        this case, "lots" is more than 50 or so.
  156.  
  157.        According to Luann Vodder who supports Microsoft Word on CompuServ:
  158.  
  159.          "There is a procedure which Windows must go through when an
  160.          application requests a font.  Each font contains a list of
  161.          attributes such as Family, FaceName, Height, Width, Orientation,
  162.          Weight, Pitch, etc.  When an application requests a font, it fills
  163.          out a logical font for Windows containing the necessary attributes,
  164.          then starts going through a font mapping algorithm to determine
  165.          which of the installed fonts most closely matches the requested
  166.          (logical) font.  Penalties are applied against fonts whose
  167.          attributes do not match the logical font, until the fonts with the
  168.          fewest penalties are determined.  If there is a "tie", Windows may
  169.          need to rely on the order of the fonts in the WIN.INI file to
  170.          determine the "winner".
  171.               
  172.        If the fonts you want are in your WIN.INI file, and show up in
  173.        Windows' Control Panel, then try moving them higher in your WIN.INI
  174.        file with a file edittor such as SYSEDIT.
  175.  
  176.    Kesh Govinder <govinder@ph.und.ac.za> suggested the following warning:
  177.  
  178.    CAUTION: While many Windows 3.1 users would like to have many
  179.    TrueType fonts at their disposal (and they are many available in the
  180.    PD) a word of caution.  A large number (>50) TT fonts will slow down
  181.    your windows startup time.  This occurs as every installed font is
  182.    listed in the win.ini file, and Windows has to go through the entire
  183.    file before starting up.  While this may not affect most users, it
  184.    will especially affect users of CorelDraw!, so be warned.
  185.  
  186.   Other Programs
  187.  
  188.     It is an unfortunate fact that almost all MS-DOS programs do things
  189.     differently.  Your best bet is to read the manual that comes with the
  190.     program you want to use.
  191.  
  192. 3. Font utilities
  193.  
  194.   PS2PK
  195.  
  196.     PS2PK allows you to convert PostScript Type1 fonts into bitmap fonts.
  197.     The bitmap files produced are in TeX PK format.
  198.  
  199.   PKtoSFP
  200.  
  201.     PKtoSFP allows you to convert TeX PK fonts into HP LaserJet softfonts.
  202.  
  203.   PFBDir/PFBInfo
  204.  
  205.     PFBDir and PFBInfo format and display the "headers" in a binary Type1
  206.     font.
  207.  
  208. 4. Converting Macintosh Type1 fonts to MS-DOS format
  209.  
  210.   Converting Macintosh Type1 fonts into PC Type1 fonts can be done using
  211.   purely free/shareware tools.  I've outlined the procedure below.  Make
  212.   sure you read the "readme" files that accompany many fonts.  Some font
  213.   authors specifically deny permission to do cross-platform conversions.
  214.  
  215.   THE TOOLS YOU NEED:
  216.   -------------------
  217.  
  218.     XBIN:   xbin23.zip in /pub/msdos/mac on oak.oakland.edu (or other mirrors)
  219.     UNSIT:  unsit30.zip in /pub/msdos/mac on oak.oakland.edu
  220.     UNCPT:  ext-pc.zip in /pub/pc/win3/util on ftp.cica.indiana.edu
  221.     REFONT: refont11.zip in /pub/pc/win3/fonts on ftp.cica.indiana.edu
  222.     BMAP2AFM: bm2af01.zip in /pub/norm/mac-font-tools on ibis.cs.umass.edu
  223.  
  224.   XBIN converts Mac "BinHex"ed files back into binary format.  BinHex is
  225.   the Mac equivalent of UUencoding, it translates files into ascii characters
  226.   so that mailers can send them around without difficulty.  It also aids in 
  227.   cross platform copying too, I'm sure.  BinHexed files generally  have 
  228.   filenames of the form "xxx.yyy.HQX".
  229.  
  230.   UNSIT explodes "Stuffit" archives.  Stuffit archives generally have
  231.   filenames of the form "xxx.SIT".
  232.  
  233.   UNCPT explodes "Compactor" archives.  The ext-pc implementation is called
  234.   "extract" and does not require windows (even thought it's in the windows
  235.   section on cica).  Compactor archives generally have filenames of the
  236.   form "xxx.CPT".
  237.  
  238.   REFONT converts Mac type1 fonts into PC type1 fonts.
  239.  
  240.   BMAP2AFM constructs AFM files from the metric information contained in
  241.   Mac screen fonts (.bmap files).  The screen font files do not have any
  242.   standard name (although they frequently have the extension .bmap).  The
  243.   screen fonts have file type "FFIL" which, in combination with some common
  244.   sense, is usually sufficient to identify them.
  245.  
  246.   I've listed the tools that I've used and the sites that are reasonable
  247.   for me to retrieve them from.  It's probably a good idea to check with
  248.   archie for closer sites if you're not in North America.  These tools run
  249.   under MS-DOS.  XBIN and UNSIT can also be run under Unix.
  250.  
  251.   HOW TO DO IT:
  252.   -------------
  253.  
  254.   Collect the Mac fonts from the archive or BBS of your choice.  Most of
  255.   these files will be in BinHexed format.  As a running example, I'm going
  256.   to use the imaginary font "Plugh.cpt.hqx".  When I download this font to
  257.   my PC, I would use the name "PLUGH.CPX".  The actual name you use is
  258.   immaterial.
  259.  
  260.   Run XBIN on PLUGH.CPX.  This will produce PLUGH.DAT, PLUGH.INF, and
  261.   PLUGH.RSR.  The data fork of the Mac file (the .DAT file) is the only one
  262.   of interest to us, you can delete the others.
  263.  
  264.   If the original file had been "Plugh.sit.hqx", we would be using the
  265.   UNSIT program.  Since I chose a .cpt file for this example, I'm going to
  266.   run UNCPT.
  267.  
  268.   Run UNCPT on PLUGH.DAT.  You want to extract the AFM file (if present),
  269.   the documentation or readme file (if present), and the Type1 outline
  270.   file.  The AFM and README files will be in the data fork of the archive
  271.   file.  The Type1 outline will be in the resource fork.  The AFM and
  272.   README files have Mac "TEXT" type.  The Type1 outline file has "LWFN"
  273.   type.  I'm not trying to describe this part in a step-by-step fashion.
  274.   Use the docs for UNCPT and UNSIT as a guide.  If you got this far you
  275.   probably won't have much difficulty.  If you do, drop me a line and I'll
  276.   try to help.
  277.  
  278.   If the font does not contain an AFM file, extract the screen font.
  279.   Screen fonts frequently have the extension .bmap and are "FFIL" type
  280.   files.  Use Bmap2AFM to construct an AFM from the screen font.  If the
  281.   archive _does_ contain an AFM file, it's safe to bet that the author's
  282.   AFM will be better than the one created by Bmap2AFM.
  283.  
  284.   Finally, run REFONT on the Type1 outline that you extracted above.  The
  285.   result should be an appropriate PC type1 outline.  REFONT will create a
  286.   PFM file for you from the AFM file, if you desire.
  287.  
  288.   Remember to register your shareware...
  289.  
  290. 5.1 Converting PC Type1 fonts into TeX PK bitmap fonts
  291.  
  292.   The release of PS2PK by Piet Tutelaers <rcpt@urc.tue.nl> is a godsend to
  293.   those of us without PostScript printers.  PS2PK converts PC/Unix format
  294.   Type 1 fonts into TeX PK files.  Used in conjunction with the AFM2TFM
  295.   utility for creating TeX metric files, this allows almost anyone to use
  296.   Type 1 PostScript fonts.  PS2PK is distributed under the GNU License and
  297.   has been made to run under MS-DOS with DJGPP's free GNU C compiler.  The
  298.   PC version requires a 386 or more powerful processor.  Check with Archie
  299.   for a source near you.
  300.  
  301.   Note: if TeX PK files are not directly usable for you, there seems to be
  302.   a fair possibility that LaserJet softfonts would be useful.  If so, check
  303.   below for instructions on converting TeX PK files to LaserJet softfonts.
  304.  
  305. 5.2 Converting TeX PK bitmaps into HP LaserJet softfonts (and vice-versa)
  306.  
  307.   There is some possibility that someone will yell 'conflict of interest'
  308.   here, but I don't think so.  I wrote the following utilities:
  309.  
  310.     PKtoSFP: convert TeX PK files to LaserJet (bitmapped) softfonts
  311.     SFPtoPK: convert LaserJet (bitmapped) softfonts to TeX PK files
  312.  
  313.   But they are completely free, so I don't gain anything by "advertising"
  314.   them here.  These are MS-DOS platform solutions only.  If you know of
  315.   other solutions, I would be happy to list them.
  316.  
  317. 5.3. TrueType to HP LaserJet bitmap softfonts (HACK!)
  318.  
  319.   If you have the tools, the following suggestion does work, but it
  320.   isn't easy and it hasn't been automated.  To be honest, I haven't
  321.   really tested it.
  322.  
  323.   If you are using Windows 3.1, get a LaserJet printer driver (you don't
  324.   need the printer, just the driver).  Using the LaserJet driver, direct
  325.   output to a file and print a simple file containing all the letters you
  326.   want in the softfont in the font that you are converting.  When the print
  327.   job has completed, the output file will contain, among other things, a
  328.   LaserJet softfont of the TrueType font you selected.  If you know the
  329.   LaserJet format, you can grab it out of there.
  330.  
  331.   I didn't say it was easy ;-)
  332.  
  333.   This method will not work with ATM [ed: as of 7/92] because ATM does
  334.   not construct a softfont; it downloads the whole page as graphics.
  335.  
  336.   Here is an overview of the LaserJet bitmap softfont format.  It should
  337.   help you get started.  If you have any questions, ask norm
  338.   <walsh@cs.umass.edu>.  If anyone wants to write better instructions... ;-)
  339.  
  340.   Many details are omitted from this description.  They are thoroughly 
  341.   discussed in the HP Technical Reference for each model of laser printer.
  342.   I recommend purchasing the Tech Ref.  If you have additional questions
  343.   and do not plan to purchase the Tech Ref (or do not wish to wait for its
  344.   arrival), you can ask norm <walsh@cs.umass.edu>.
  345.  
  346.   An HP LaserJet softfont can occur almost anywhere in the output stream
  347.   destined for the printer.  In particular, it does _not_ have to be
  348.   wholly contiguous within the output file.  In fact, fonts can be
  349.   "intermixed" at will.  The following "pieces" make up a font:
  350.  
  351.   A begin font descriptor command (followed by the descriptor) and a
  352.   series of begin character descriptor commands (followed by their
  353.   associated data).  When a new character descriptor is encountered, it
  354.   is added to the _current_ font (which may change between descriptors).
  355.  
  356.   In the discussion that follows, the following notational conventions
  357.   are followed:
  358.  
  359.     Key elements are surrounded by quotation marks.  The quotation marks
  360.     are not part of the element.  Spaces within the element are for
  361.     clarity only, they are not part of the element.  All characters
  362.     (except ESC and #, described below, are _literal_ and must be
  363.     entered in the precise case shown).
  364.  
  365.     ESC means the escape character, ASCII character number 27 decimal.
  366.   
  367.     # means any decimal number.  The meaning of the number is described
  368.     in the commentary for that element.
  369.   
  370.   What is a font descriptor?  A font descriptor begins with a font
  371.   descriptor command and is followed immediately by the data for the
  372.   descriptor.  Font descriptors define data global to the font.  In
  373.   general, more recent printers are less strict about these parameters
  374.   than older printers.
  375.   
  376.   What is the font descriptor command?
  377.   
  378.    "ESC ) s # W"
  379.   
  380.      In this command, # is the number of bytes in the descriptor.  The
  381.      first element of the descriptor indicates how many of these bytes
  382.      should be interpreted as the font descriptor (the remaining bytes
  383.      are commentary only--to the printer, at least).  This area is
  384.      frequently used for copyright information, for example, although
  385.      some systems insert kerning data into this area.
  386.   
  387.   What is the font descriptor data?
  388.   
  389.     The data is:
  390.   
  391.       UI  Font descriptor size
  392.       UB  Descriptor format
  393.       UB  Font type
  394.       UI  Reserved (should be 0)
  395.       UI  Baseline distance
  396.       UI  Cell width
  397.       UI  Cell height
  398.       UB  Orientation
  399.        B  Spacing
  400.       UI  Symbol set
  401.       UI  Pitch
  402.       UI  Height
  403.       UI  xHeight
  404.       SB  Width Type
  405.       UB  Style
  406.       SB  Stroke Weight
  407.       UB  Typeface LSB
  408.       UB  Typeface MSB
  409.       UB  Serif Style
  410.       SB  Underline distance
  411.       UB  Underline height
  412.       UI  Text Height
  413.       UI  Text Width
  414.       UB  Pitch Extended
  415.       UB  Height Extended
  416.       UI  Cap Height
  417.       UI  Reserved (0)
  418.       UI  Reserved (0)
  419.       A16 Font name
  420.       ??  Copyright, or any other information
  421.   
  422.     Where, UI=unsigned integer, SI=signed integer,
  423.            UB=unsigned byte,    SB=signed byte,
  424.             B=boolean,          A16=sixteen bytes of ASCII
  425.   
  426.     After the font name, ?? bytes of extra data may be inserted.  These
  427.     bytes pad the descriptor out to the length specified in the begin
  428.     font descriptor command.
  429.   
  430.     Note: integers are _always_ in big-endian order (MSB first).
  431.   
  432.   What is a character descriptor?  A character descriptor describes the
  433.   character specific info and the layout of the bitmap.  Newer printers
  434.   can accept compressed character bitmaps.
  435.   
  436.   What is a character descriptor command?
  437.   
  438.     "ESC * c # E"
  439.   
  440.       The # is the length of the descriptor, in bytes.
  441.   
  442.   What is the character descriptor data?
  443.   
  444.     UB  Format
  445.      B  Continuation
  446.     UB  Descriptor size
  447.     UB  Class
  448.     UB  Orientation
  449.     SI  Left offset
  450.     SI  Top offset
  451.     UI  Character width
  452.     UI  Character height
  453.     SI  Delta X
  454.     ??  Character (bitmap) data.
  455.   
  456.     Although older printers cannot accept characters that include
  457.     continuations, newer printers can.  If the "continuation" field is
  458.     1, the character bitmap data begins immediately after that byte and
  459.     the remaining fields _are not_ present.
  460.   
  461.   Ok, now I understand the data, what do I look for in the output stream?
  462.   
  463.     "ESC * c # D"  defines the font number (remember the number).
  464.     "ESC ) s # W"  defines the font descriptor (as described above).
  465.     "ESC * c # E"  specifies the character code (the #, in this case).
  466.                    The next character descriptor maps to this position in
  467.                    the font.  Characters do not have to appear in any 
  468.            particular order.
  469.     "ESC ( s # W"  defines the character descriptor (as described above).
  470.   
  471.     Remember, these can occur in any order.  Experimentation with the
  472.     particular driver you are using may help you restrict the number of
  473.     different cases that you have to be prepared for.
  474.   
  475.   Please report your experiences using this method to norm
  476.   <walsh@cs.umass.edu> (both to satisfy his own curiosity and to help
  477.   improve the FAQ).
  478.  
  479. 6.  MS-DOS Screen Fonts (EGA/VGA text-mode fonts)
  480.  
  481.   Editors note: the following description was mercilessly stolen from
  482.                 comp.archives on 02SEP92.  It was originally Yossi Gil's
  483.                 <yogi@cs.ubc.ca> posting.
  484.  
  485.  
  486.   FNTCOL12.ZIP contains more than 100 text mode fonts for EGA/VGA displays.  
  487.   It includes fonts in different sizes for Hebrew, Greek, Cyrillic, math 
  488.   symbols and various type styles including smallcaps and script.
  489.  
  490.   It is available at cs.ubc.ca in /pub/pickup/terse/fntcol12.zip
  491.  
  492. -- END OF PART III --
  493.